﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TemplatesPrint.DBHelper;
using TemplatesPrint.Entitys;

namespace TemplatesPrint.EntityHandle
{
   public  class CodeInfoHandle
    {
       public  static void SaveCode(string clientInfo, string msgid, string code, string codeType ,string status)
        {
            using (var db = SQLiteHelper.GetInstance())
            {
                var codeEntity = new CodeInfoEntity();
                codeEntity.Status = status;
                codeEntity.MsgId = msgid;
                codeEntity.Source = clientInfo;

                codeEntity.Barcode = code;
                codeEntity.Type = codeType;
                codeEntity.CreateTime = codeEntity.UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
                db.Insertable(codeEntity).ExecuteCommand();
            };
        }
    }
}
